import React, { useContext } from 'react';
import { context } from '../../components/StateBus';
import { Modal, Form, Input } from 'antd';

function Counter1({ p, form }) {
  const { state, dispatch } = useContext(context);
  const onIncr = () => {
    dispatch({ type: 'incrE', payload: '' });

  };
  console.log('Counter1')
  return (
    <div>
      Counter Count: {state.count}
      <button onClick={() => dispatch({ type: 'reset1' })}>Reset</button>
      <button onClick={() => onIncr()}>+</button>
      <button onClick={() => dispatch({ type: 'decrE' })}>-</button>
    </div>
  );
}

export default Counter1;
